﻿using System.Collections.Generic;
using System.Collections.Specialized;

namespace iHouse.Infrastructure
{
    public abstract class SearchFilterBase : IFilterCollect
    {
        protected Dictionary<string, object> FilterCollection
        {
            get;
            set;
        }

        protected abstract void Collect(NameValueCollection contain);

        #region IFilterCollect Member

        Dictionary<string, object> IFilterCollect.Collect(object contain)
        {
            FilterCollection = new Dictionary<string, object>();
            NameValueCollection queryString = contain as NameValueCollection;
            this.Collect(queryString);

            return FilterCollection;
        }

        #endregion
    }
}
